# 文件读写
# 'w' 写 模式 源文件若不存在，则创建新文件 会覆盖源文件内容
# 'a' 追加模式 源文件若不存在，则创建新文件 会在源文件末尾追加内容
# 'r' 读模式


# f = open('test.txt','w',encoding='utf8')
#
# f.write('hello world')
#
# f.close()
# f = open('test.txt','a',encoding='utf8')
# f.write('\nhello world')
# f.close()
# f = open('test.txt','r',encoding='utf8')
# content = f.read()
# print(content)
# f.close()

# def fileCopy(srcPath,destPath):
#     srcF = open(srcPath,'rb')
#     content = srcF.read()
#     srcF.close()
#
#     destF = open(destPath,'wb')
#     destF.write(content)
#     destF.close()
#
# fileCopy('test.txt','test_copy.txt')
# fileCopy('1.jpg','1copy.jpg')
#
# with open('test.txt','r',encoding='utf8') as f:
#     content = f.read()
#     linelist = content.splitlines()
#     for i in linelist:
#         print(i)

# file = open('test.txt', 'a', encoding='utf-8')
# file.write('\thello python')
# file.close()

# with open('test.txt', 'r', encoding='utf-8') as file:
#     # content = file.read()
#     # content = file.readline()
#     content = file.readlines()
#     print(content)
